package com.cskaoyan.mapper;

import com.cskaoyan.bean.User;
import com.cskaoyan.bean.User2;
import org.apache.ibatis.annotations.ConstructorArgs;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 创建日期: 2022/10/14 16:14
 *
 * @author ciggar
 */
public interface UserMapper {


    //一个简单类型
    Integer selectIdByName(@Param("name") String name);


    // 多个简单类型
    // select name from user;
    String[] selectAllNameList();


    // 单个JavaBean
    User selectUserById(@Param("id") Integer id);

    // 单个JavaBean
    User2 selectUserById2(@Param("id") Integer id);


    // 多个JavaBean
    List<User> selectAllUserList();


    // resultMap
    User2 selectUser2ById(@Param("id") Integer id);

    int insertUser(@Param("id") Integer id, @Param("name") String name, @Param("age") Integer age, @Param("nickname") String nickname);


}
